tests: 'install' defaults to current directory
authorBoris Egorov <egorov@linux.com>
Thu, 17 Dec 2015 16:41:05 +0000 (22:41 +0600)
committerBoris Egorov <egorov@linux.com>
Thu, 17 Dec 2015 16:41:05 +0000 (22:41 +0600)
Complements #2205.

Fixes #2142.

tests/test_cargo_install.rs

index 5897a880ae8d9df3beb1796c38574603f5f40ae3..9a99c403aa4dbc6cc63cafae26a17173575017c6 100644 (file)
@@ -122,8 +122,7 @@ could not find `foo` in `registry file://[..]` with version `0.2.0`
 test!(no_crate {
     assert_that(cargo_process("install"),
                 execs().with_status(101).with_stderr("\
-must specify a crate to install from crates.io, or use --path or --git \
-to specify alternate source
+Could not find Cargo.toml in `[..]`
 "));
 });
 
@@ -528,3 +527,18 @@ test!(subcommand_works_out_of_the_box {
     assert_that(cargo_process("--list"),
                 execs().with_status(0).with_stdout_contains("  foo\n"));
 });
+
+test!(installs_from_cwd_by_default {
+    let p = project("foo")
+        .file("Cargo.toml", r#"
+            [package]
+            name = "foo"
+            version = "0.1.0"
+            authors = []
+        "#)
+        .file("src/main.rs", "fn main() {}");
+    p.build();
+
+    assert_that(cargo_process("install"), execs().with_status(0));
+    assert_that(cargo_home(), has_installed_exe("foo"));
+});